<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>微信好友数量</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=e9c5bb62">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=66b457d6">
    <style type="text/css">
        .btn oaBtn btn-sm {
            background: url(/dist/img/btn-bj2.png) repeat-y !important;
            background-size: 100% 100% !important;
            color: #fff !important;
            padding: 2px 10px;
            font-size: 12px;
            line-height: 1.5;
        }

        html {
            overflow: hidden;
        }

        .appDown {
            color: rgba(255, 255, 255, 0.8);;
            cursor: pointer;
            position: relative;
            padding: 0 10px;
        }

        .appDown img {
            position: absolute;
            left: -100px;
            top: 50px;
            border: 2px solid #ddd;
            display: none;
        }

        .appDown:hover img {
            display: block;
        }

    </style>
</head>
<body style="height: auto;">
<section style="padding: 15px 20px;padding-bottom: 0;" id="contactsList">
    <div>
        <input type="text" v-model="searchName">
        <input type="button" value="搜索" class="btn oaBtn pull-right btn-sm"
               style="margin-left: 10px;margin-bottom: 15px;" @click="search()" id="addButton"/>
    </div>

    <div style="margin-top: 17px" id="tableDiv" class="                                             ">
        <div id="progress" class="wyui-progress"></div>
        <table class="table table-hover table-bordered text-center table-striped" style="width: 350px;">
            <thead>
            <tr style="height: 30px;font-family: 宋体;background-color: #F8F8F8">
                <th style="width: 80px;text-align:center;">区域经理</th>
                <th style="width: 80px;text-align:center;">微信好友数量</th>
                <th style="width: 100px;text-align:center;">创建日期</th>
            </tr>
            </thead>
            <tbody>
            <tr v-for="item in list" style="height: 30px;font-family: 宋体;">
                <td style="text-align: center">{{item.userName}}</td>
                <td style="text-align: center">{{item.contacts}}</td>
                <td style="text-align: center">{{item.createTime}}</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="oa-pager text-center" style="margin-top: 5px;">
        共
        <span id="allCount"> 0 </span>条记录&nbsp;&nbsp;&nbsp;
        <span id="nowPage"> 1 </span>/<span id="allPage">1</span>&nbsp;&nbsp;&nbsp;
        <span class="oa-pager-button" id="first">首页</span>
        <span class="oa-pager-button" id="prev">上一页</span>
        <span class="oa-pager-button" id="next">下一页</span>
        <span class="oa-pager-button" id="last">尾页</span>
    </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>

<script>
    $.wyui.page.dataUrl = server.ip + "/weChatContacts/getByUserName.json";
    $.wyui.page.queryParams = {
        userName: '',
        requestPage: 1,
        pageSize: 2
    };
    var app = new Vue({
        el: '#contactsList',
        data: {
            list: [],
            searchName: ''
        },
        mounted: function () {
        },
        methods: {
            search: function () {
                var that = this;
                $.wyui.page.queryParams = {
                    userName: that.searchName,
                    requestPage: 1,
                    pageSize: 2
                };
                $.wyui.page.getByPage();
            }

        }
    })
    $.wyui.page.getByPage_callback = function (records) {
        console.log(records);
        app.list = records;
    };
    $.wyui.page.getByPage_scroll_callback = function (list) {
        if (list.length < 30) {
            isLoad = false;
        } else {
            for (var i = 0; i < list.length; i++) {
                app.list.push(list[i]);
            }
            isLoad = true;
        }
    };
</script>
</body>
</html>